feat(compliance): PR 3 — StoreFullInputs sidecar payloads file#3
Merged
Conversation
Add opt-in Config.StoreFullInputs that writes raw input/output JSON to a sidecar JSONL file at AuditPath+".payloads". The main chain and AuditStore interface are unchanged. - payloadWriter appends payloadEntry records (audit_id, timestamp, event_type, input, output) to the sidecar file, mode 0600 enforced - Messages.New writes full params+response after each allowed LLM call - Messages.NewStreaming writes params at stream start - Audit() writes event.Metadata as input payload when non-empty - PayloadsPath() exposes the sidecar path for operators - StoreFullInputs=false (default) creates no sidecar file and adds zero overhead to the hot path Enables EU AI Act Article 12 auditors to replay exactly what the agent sent and received without changing the tamper-evident chain format. gosec: 0 issues (3 nosec); go test -race: PASS; govulncheck: clean Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
97facb9 to
c3542f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Config.StoreFullInputs bool(default false) — opt-in to store raw input/output JSON alongside the Merkle chainAuditPath+".payloads"(mode 0600) containingpayloadEntryrecords keyed byaudit_idMessages.Newwrites fullparams+respJSON after each allowed LLM callMessages.NewStreamingwritesparamsJSON at stream startAudit()writesevent.Metadataas the input payload when non-emptyPayloadsPath() stringexposes the sidecar path for operators/toolingAuditStoreinterface is unchanged — no breaking changesEU AI Act Article 12
Closes the Granularity PARTIAL item: auditors can now replay exactly what the agent sent and received. StoreFullInputs is opt-in to respect deployments where storing raw LLM payloads is a privacy concern.
Test plan
TestStoreFullInputsCreatesPayloadsFile— file created with mode 0600, PayloadsPath() correctTestStoreFullInputsDisabledNoFile— no file when StoreFullInputs=falseTestStoreFullInputsAuditWritesPayload— Audit() with metadata writes payload entrygo test -race ./...PASSgosec ./...0 issues (3 nosec: G304 on construction-time paths)govulncheck ./...clean🤖 Generated with Claude Code